import React, { useState, useEffect } from 'react';
import { connect } from 'dva';
import { IndexPageStyle, IndexPageContent } from './style.js';
import TopPage from '../components/topPage/index.jsx';
import DataGovernance from '../components/leftPage/DataGovernance.jsx';
import DigitalApplication from '../components/centerPage/DigitalApplication.jsx';
import ProjectDelivery from '../components/rightPage/ProjectDelivery.jsx';
import { generateData } from '../components/meidi/utils.js';

const IndexPage2 = () => {
  const [data, setData] = useState(null);

  useEffect(() => {
    // 组件加载时初始化数据
    setData(generateData());
  }, []);


  if (!data) return <div>Loading...</div>;

  return (
    <IndexPageStyle>
      <TopPage />
      <IndexPageContent>
        <DataGovernance data={data} />
        <DigitalApplication data={data} />
        <ProjectDelivery data={data} />
      </IndexPageContent>
    </IndexPageStyle>
  );
};
export default connect()(IndexPage2);